package com.example.springboot.controller.admin;

import com.example.springboot.model.form.Result;
import com.example.springboot.model.req.admin.MusicInfoReq;
import com.example.springboot.service.admin.MusicInfoService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;

/**
 * @ClassName MusicInfoController
 * @version 1.0
 * @author zf
 * @since 2023-12-15
 * @音乐基本信息表
 *
 */
@RestController
@RequestMapping("/music")
public class MusicInfoController {

    @Resource
    private MusicInfoService service;

    /**
     *@Description: 列表
     * @param req
     */
    @PostMapping("/list")
    public Result list(MusicInfoReq req){
        return Result.buildSuccess(service.getPage(req));
    }
//
//    /**
//     *@Description: 新增
//     * @param req
//     */
//    @PostMapping("/save")
//    public BaseResult save(@RequestBody @Validated(ValidationGroups.Insert.class) MusicInfoEntity req){
//        return BaseResultResponseUtil.success(service.addInfo(req));
//    }
//
//    /**
//     *@Description: 修改
//     * @param req
//     */
//    @PostMapping("/update")
//    public BaseResult update(@RequestBody @Validated(ValidationGroups.Update.class) MusicInfoEntity req){
//        return BaseResultResponseUtil.success(service.addInfo(req));
//    }

    /**
     *@Description: 详情
     * @param id
     */
    @GetMapping("/info")
    public Result getById(@NotNull(message = "id不能为空") Long id){
        return Result.buildSuccess(service.getInfo(id));
    }

//    /**
//     *@Description: 批量删除
//     * @param ids
//     */
//    @GetMapping("/deleteIds")
//    public BaseResult deleteInfos(@NotBlank(message = "id不能为空") String ids) {
//        return BaseResultResponseUtil.success(service.deleteInfos(ids));
//    }
}

